﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Core.Unity {
    public abstract class CommandBase : IXCommand, INotifyPropertyChanged {
        public event PropertyChangedEventHandler PropertyChanged;

        private bool _IsEnabled = true;

        public virtual bool IsEnabled {
            get {
                return _IsEnabled;
            }
            set {
                if (_IsEnabled != value) {
                    _IsEnabled = value;
                    if (this.PropertyChanged != null) {
                        this.PropertyChanged(this, new PropertyChangedEventArgs("IsEnabled"));
                    }
                }
            }
        }

        public virtual void OnCreate(object hook) {

        }

        public virtual void OnClick(object parameter) {

        }

        public virtual void UpdateEnabled(params object[] parameters) {
            
        }

        public virtual void UpdateChecked(params object[] parameters) {
             
        }
    }
}
